
const data_config = require("./data_config");


module.exports = {
  nav_name: '拼团管理', //生成导航菜单
  module_name: 'ping_tuan_m',  //生成路径，必须与文件名相同
  api: `{
    page: commonPath + "/admin/spell_product/page", //分页
    changeState: commonPath + '', //状态

    ping_tuan_sort: cPath + "/admin/first_kinds/list", //拼团类目page
    add: commonPath + '/admin/spell_product/add', //发团

    cancel: cPath + "/admin/spell_product/cancel", //取消发团
    ping_tuan_page: cPath + "/admin/order/page", //拼团订单列表
  }`, //接口

  //拼团列表
  table1: {
    // isGenerate: "false", //false表示不生成页面
    table_name: "ping_tuan_table",  //表页面名
    nav_name: "拼团列表",  //导航名
    tipsText: "拼团管理 >> 拼团列表", //顶部文字
    // tableReqMethod: "get",  //分页请求配置成get方式, 默认为post
    pageApi: "API.ping_tuan_m.page",  //请求api
    // extraPageRequestParams: `
    //   courseId: this.$route.query.id,  //请求
    // `, //已有page和pageSize
    //获取列表页面
    tableData: [
      //普通
      { title: '序号', name: 'index', type: "normal" },
      { title: '编号', name: 'id', type: "normal" },
      { title: '商品名', name: 'name', type: "normal" },  
      { title: '拼团金额', name: 'price', type: "normal" }, 
      {
        title: '主图',
        name: 'mainImgUrl',
        type: "img",
        heightVal: "60",
        widthVal: "100",
      },
      { title: '最大人数', name: 'maxNumber', type: "normal" },
      { title: '当前参与人数', name: 'currentNumber', type: "normal" },
      { 
        title: '状态', 
        name: 'state', 
        type: "opts", 
        showName: "stateShow",
        showObj: `{
          "0": "无效",
          "1": "有效",
        }` 
      },
      { 
        title: '拼团状态', 
        name: 'spellState', 
        type: "opts", 
        showName: "spellStateShow",
        showObj: `{
          "0": "取消拼团",
          "1": "拼团中",
          "2": "拼团成功",
        }` 
      },
      { title: '开团时间', name: 'startDate', type: "normal" },
      { title: '创建时间', name: 'createDate', type: "normal" },
       
    ],
    tableOpt: [
      {
        type: "view",
        text: "查看",
        request: false,
        jump: "/ping_tuan_m_ping_tuan_dt"
      },
      // //删除功能
      // {
      //   type: "del",
      //   text: "删除",
      //   request: true,
      //   url: "API.identify_manager.del",
      //   requestType: 'post',
      //   isSplitSearchString: 'true',  //拼接查询字符串（post需要，get不需要）。
      // },
      {
        type: "changeState",
        text: "取消",
        request: true,
        url: "API.ping_tuan_m.cancel",
        requestType: 'get',
        params: `{id }`, //必须为文本
        methodNameTag: 'Close', //方法衔接拓展名 changeState Black
        showCondition: `scope.row.state == '1'`,  //展示条件，没有就不传或置为空
      },
    ],
    search: {
      contentArr: {
        input1: { labelName: '编号', inputName: 'id' },
        input2: { labelName: '拼团金额', inputName: 'price' },
        select1: {
          labelName: '拼团状态',
          inputName: 'spellState',  //输入绑定的变量
          selectOptsName: "spellStateOpts",
          selectOptsArr: `[
            { value: "0", label: "取消拼团" },
            { value: "1", label: "拼团中" },
            { value: "2", label: "拼团成功" },
            { value: "", label: "请选择" },
          ],
          `, //选项数组
        },
      },
      //查找按钮的文字
      searchBtn: {
        text: "查询", //链接与table请求接口相同，不做另外配置
      },
      //添加按钮
      addBtn: {
        //搜索栏具有添加功能按钮时，设置此字段
        type: "add",
        text: "发布拼团",
        request: false,
        jump: "/ping_tuan_m_add_fa_tuan", //添加的跳转按钮
      }
    },    
  },

  
  //拼团详情订单
  table2: {
    // isGenerate: "false", //false表示不生成页面
    table_name: "ping_tuan_dt",  //表页面名
    // nav_name: "拼团详情订单",  //导航名
    tipsText: "拼团管理 >> 拼团详情订单", //顶部文字
    // tableReqMethod: "get",  //分页请求配置成get方式, 默认为post
    pageApi: "API.ping_tuan_m.ping_tuan_page",  //请求api
    extraPageRequestParams: `
      id: this.$route.query.id,  //拼团id
    `, //已有page和pageSize
    //获取列表页面
    tableData: [
      { title: '序号', name: 'index', type: "normal" },
      { title: '用户id', name: 'tel', type: "normal", showObj: "{}" },
      { title: '手机号', name: 'temp', type: "normal", showObj: "{}" },
      {
        title: '状态',
        name: 'userState',
        type: "opts",
        showName: "userStateShow",
        showObj: `{
          "1": "已结算",
          "2": "未结算",
        }`
      },
      {
        title: '结果',
        name: 'settleType',
        type: "opts",
        showName: "settleTypeShow",
        showObj: `{
          "1": "拼中奖励",
          "5": "退回参团金额",
        }`
      },
    ],
    tableOpt: [
    ],
    search: {
      contentArr: {
        // input1: { labelName: '编号', inputName: 'id' },
        // input2: { labelName: '产品id', inputName: 'price' },
      },
      //查找按钮的文字
      // searchBtn: {
      //   text: "查询", //链接与table请求接口相同，不做另外配置
      // },
      //添加按钮
      // addBtn: {
      //   //搜索栏具有添加功能按钮时，设置此字段
      //   type: "add",
      //   text: "发布拼团",
      //   request: false,
      //   jump: "/ping_tuan_m_add_fa_tuan", //添加的跳转按钮
      // }
    },    
  },
  
  //发团页面
  add_page1: {
    // isGenerate: "false", //false表示不生成页面
    add_page_name: "add_fa_tuan",  //尽量短些,要拼接路由
    tipsText: "拼团管理 >> 发团",
    // pageApi: "API.sys_setting.sys_setting_page",  //请求api
    formData: {
      // titleText: "请填写管理员相关信息",
      select1_1: {
        labelName: '类目',
        inputName: 'firstKinds',  //输入绑定的变量
        selectOptsName: "pingTuanSort",
        selectOptsArr: `[],
          `, //选项数组
        isNeed: 'true',
      },
      input1: {
        labelName: '拼团产品名称',
        inputName: 'name',
        isNeed: 'true',
        // disabled: 'true', //为true时禁用
      },
       //图片上传
       uploadImg1: {
        labelName: "主图",
        inputName: "mainImgUrl",
        type: "many", //type: "single"
        countLimit: "1",
        uploadMethod: "handleUploadBanner",
        isNeed: 'true',
      },
  
      textarea1: {
        labelName: '详情介绍',
        inputName: 'details',
        isNeed: 'true',
        rows: "5",
        width: "360", //自动补全px
        isNeed: 'true',
      },
      
      input2: {
        labelName: '发团数量',
        inputName: 'num',
        isNeed: 'true',
      },
      input3: {
        labelName: '金额',
        inputName: 'price',
        isNeed: 'true',
      },

    },
    addBtn: {
      text: '立即发布',
      url: "API.ping_tuan_m.add",
      extraParams: ` courseId: Number(this.$route.query.courseId), `, //请求的额外参数
      jumpPath: "/ping_tuan_m_ping_tuan_table",
      // extraQueryParams: ` { id: this.$route.query.courseId } `, //跳转时携带参数
    }, //
    editBtn: {
      text: '编辑',
      detailUrl: "API.ping_tuan_m.detail", //默认get方式请求
      // detailType: 'get', //请求方式
      isSplitSearchString: 'true', //拼接查询字符串, get和post的必须字段
      // extraParams: ` courseId: Number(this.$route.query.courseId), `, //请求的额外参数
      editUrl: "API.ping_tuan_m.edit",
      jump: '/ping_tuan_m_ping_tuan_table'
    },
    cancelBtn: { text: "取消" }, //
    //额外请求
    extraRequest: {
      dataCode: [
        "pingTuanSort"
      ],
      methodsCode: [
        {
          explainText: "获取类目", //说明
          type: "opts",  //表示选项类型格式，value, label
          methodName: "getLeiMuF",
          api: "API.ping_tuan_m.ping_tuan_sort",
          optsName: "pingTuanSort",
          params: `{
            
          }`,
          optsConfig: {
            label: "name",
            value: "id"
          },
        }
      ]
    },
  },

 
}

